package cn.com.zs.android.util;

import android.content.SharedPreferences;
import cn.com.zs.android.model.GameParams;

/**
 * 音效管理
 * @author 曾帅
 */
public class VoiceSettings {
	
	public static SharedPreferences fighthamster_settings;
	
	public static void createObject(SharedPreferences fighthamster_settings) {
		VoiceSettings.fighthamster_settings = fighthamster_settings;
	}

	/**
	 * 开启背景音乐
	 */
	public static void openBackgroundMusic() {
		fighthamster_settings.edit().putBoolean("fighthamster_background_music", true).commit();
		GameParams.isBackgroundMusic = true;
	}
	
	/**
	 * 关闭背景音乐
	 */
	public static void closeBackgroundMusic() {
		fighthamster_settings.edit().putBoolean("fighthamster_background_music", false).commit();
		GameParams.isBackgroundMusic = false;
	}
	
	/**
	 * 开启系统声音
	 */
	public static void openSystemSound() {
		fighthamster_settings.edit().putBoolean("fighthamster_system_sound", true).commit();
		GameParams.isSystemSound = true;
	}
	
	/**
	 * 关闭系统声音
	 */
	public static void closeSystemSound() {
		fighthamster_settings.edit().putBoolean("fighthamster_system_sound", false).commit();
		GameParams.isSystemSound = false;
	}
}
